<?php
    $this->breadcrumbs=array(
    'Posts'=>array('index'),
    $model->title,
    );

    $this->menu=array(
    array('label'=>'List Post', 'url'=>array('index')),
    array('label'=>'Create Post', 'url'=>array('create')),
    array('label'=>'Update Post', 'url'=>array('update', 'id'=>$model->id)),
    array('label'=>'Delete Post', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
    array('label'=>'Manage Post', 'url'=>array('admin')),
    );
?>



<div class="view">
    <h3><?php
            echo  $model->title;
    ?></h3>
    <div>
     <?php
            if($model->image!='')
            {
            ?>
            <img width="200" src="<?php echo Yii::app()->request->getBaseUrl(true)."/images/".$model->image?> " alt="" class="image-post"/>
            <?php
            }
        ?>
        <?php
            echo $model->content;
        ?>
    </div>
    <br/>
    <div >
        <?php echo Yii::t('Site','CREATE DATE').': '.date('d F Y',  strtotime($model->create_time));
        ?>
    </div>
    <div >
        <?php echo Yii::t('Site','TAG').': '.implode(', ', $model->tagLinks); ?>      
    </div>

    <br/>
    <br/>


    <div id="comments">
        <?php  if($model->commentCount>=1): ?>
              <?php $this->widget('zii.widgets.CListView', array(
                'id'=>'list-comment',
                'dataProvider'=>$dPComment,
                'itemView'=>'/comment/_view',
                'template'=>"<div>{summary}</div>\n{items}\n{pager}",
                'summaryText'=>'{count} '.Yii::t("Site","COMMENT"),

                )); ?>
            <?php endif; ?>


        <br/>
        <br/>

        <h3><?php
    echo Yii::t('Site','LEAVE COMMENT')
?></h3>

        <?php if(Yii::app()->user->hasFlash('commentSubmitted')): ?>
            <div class="flash-success">
                <?php echo Yii::app()->user->getFlash('commentSubmitted'); ?>
            </div>
            <?php else: ?>
            
            <?php $this->renderPartial('/comment/_form',array(
                'model'=>$comment,
                //tranfer the post for commnet
                'post'=>$model,
                )); ?>
            <?php endif; ?>
    </div>
</div>
